<template>
	<view>
		<view v-for="(row,index) in list" :key="index">
			<!-- 顶部状态栏 -->
			<view v-if="row.type=='top-status-bar'" :class="(row.container && row.container.class) || ''" :style="(row.container && row.container.style) || ''">
				<gt-status-bar></gt-status-bar>
			</view>
			<!-- 标题 -->
			<view v-else-if="row.type == 'title'" :class="(row.container && row.container.class) || ''" :style="(row.container && row.container.style) || ''">
				<view  :class="row.class || ''" :style="row.style || ''">{{row.text}}</view>
			</view>
			<!-- 轮播图 -->
			<view v-else-if="row.type=='carousel'" :class="(row.container && row.container.class) || ''" :style="(row.container && row.container.style) || ''">
				<swiper class="carousel" :class="row.class || ''" :style="row.style || ''" indicator-dots=true indicator-active-color="#fff" autoplay=true>
					<swiper-item v-for="(item ,key) in row.items" :key="key"  >
						<view class="bg-img bg-img-cover pointer"  :class="item.class || ''" :style="item.style || ''"
							@click="$skip.to(item.skip_url)"></view>
					</swiper-item>
				</swiper>
			</view>
			<!-- 分类icon -->
			<view v-else-if="row.type=='icon'" :class="(row.container && row.container.class) || ''" :style="(row.container && row.container.style) || ''">
				<view v-for="(item ,key) in row.items" :key="key" :class="row.class || ''" :style="row.style || ''" @click="$skip.to(item.skip_url)">
					<view class="bg-img mg-auto w-h-50" :style="'background:url('+item.img_url+')'"></view>
					<view style="margin-top: 5px; text-align: center;">{{item.name}}</view>
				</view>
			</view>
			<!-- common -->
			<view v-else-if="row.type=='common'" :class="row.class || ''" :style="row.style || ''" >
				<view  v-for="(item ,key) in row.items" :key="key" :class="item.class || ''" :style="item.style || ''" @click="$skip.to(item.skip_url)">
					{{item.text || ''}}
				</view>
			</view>
			<view style="clear: both;"></view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "gt-select",
		props: {
			list: {
				type: [Array],
				default: function() {
					return [];
				}
			}
		},
		created() {},
		data() {
			return {
			}
		},
		methods: {
		}
	}
</script>

<style>
	
</style>
